package com.gdepri.cabelwellserver;

import com.gdepri.cabelwellserver.server.Server;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.io.IOException;
import java.util.Iterator;

@SpringBootApplication
@MapperScan ("com.gdepri.cabelwellserver.dao")
public class YibuprojectApplication {

    public static void main(String[] args) throws IOException {
        System.out.println("hello world");
        ConfigurableApplicationContext run = SpringApplication.run(YibuprojectApplication.class, args);
        ConfigurableListableBeanFactory beanFactory = run.getBeanFactory();
        Object server = beanFactory.getBean("server");
        Server serverInstance = (Server) server;
        serverInstance.init();
    }

}
